Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use simple equality string matching when possible #14

Merged
merged 13 commits into from
Jan 20, 2024
Merged

Conversation

etianen
Copy link
Owner

@etianen etianen commented Jan 20, 2024

The compile_matcher function now returns a Callable. This allows us to return one of two possible implementations:

  • re.Pattern.fullmatch()
  • str.__eq__

This allows significantly faster compilation and matching for non-regex patterns.

@etianen etianen changed the title Dh/str matcher Use simple equality string matching when possible Jan 20, 2024
@etianen etianen merged commit 5e71d51 into main Jan 20, 2024
7 checks passed
@etianen etianen deleted the dh/str-matcher branch January 20, 2024 21:15
@etianen etianen added the enhancement New feature or request label Jan 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant